package wql.aaa.controller;

import com.aaa.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import wql.aaa.service.OssService;

/**
 * @author wql
 * @version 1.0
 * @date 2023/3/1 14:53
 */

@RestController//交给spring管理 返回数据
@RequestMapping("/home/banner")
public class OssController {

    @Autowired
    private OssService ossService;

    //上传轮播图
    @PostMapping("/upload")
    public Result uploadOssFile(MultipartFile file){
        //获取上传文件 MultipartFile
        String url = ossService.upload(file);
        return new  Result(2000,"上传成功",url);
    }
}
